
//引入两个常量
import { INCREMENTCOUNT, DECREMENTCOUNT } from '../constant/countConst'
import store from '../store'
//累加 定义一个函数
export const incrementAction = (data) => {

  return {
    type: INCREMENTCOUNT,
    data
  }
}

//累减
export const decrementAction = (data) => {
  return {
    type: DECREMENTCOUNT,
    data
  }
}

//延时 
export const waitcrementAction = (data = 1) => {
  //异步actions
  return () => {
    setTimeout(() => {
      store.dispatch({
        type: INCREMENTCOUNT,
        data
      })
    }, 2000)
  }
}